/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: Test
 * Author:   zhouheng
 * Date:     2018/7/27 21:01
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.hengby.hengcrud.core.base;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author zhouheng
 * @create 2018/7/27
 * @since 1.0.0
 */

@Setter
@Getter
class Ball{
    private Ball pref;
    private Ball next;

    private int flag = 0;
}

public class Test {
    private static int count = 30;
    private  static int index = 0;

    public void main(String[] args){
        List<Ball> list = new ArrayList<>(30);


    }

    public void cycle(List<Ball> list){
        if (count == 15){
            return;
        }else {


            for (index = 0; index < count; index++){
                int j = index + 13;
                // 将该球设置为红
                list.get(j).setFlag(1);

                index = j+1;
                count--;

                // 继续循环
                cycle(list);

            }
        }
    }

}